<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>Assimp: Assimp::BaseImporter Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">Assimp
   &#160;<span id="projectnumber">v3.0 (July 2012)</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.1.1 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="namespace_assimp.html">Assimp</a></li><li class="navelem"><a class="el" href="class_assimp_1_1_base_importer.html">BaseImporter</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="class_assimp_1_1_base_importer.html#pub-methods">Public Member Functions</a> &#124;
<a href="class_assimp_1_1_base_importer.html#pub-static-methods">Static Public Member Functions</a> &#124;
<a href="class_assimp_1_1_base_importer.html#pro-methods">Protected Member Functions</a> &#124;
<a href="class_assimp_1_1_base_importer.html#pro-attribs">Protected Attributes</a> &#124;
<a href="class_assimp_1_1_base_importer.html#friends">Friends</a>  </div>
  <div class="headertitle">
<div class="title">Assimp::BaseImporter Class Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>FOR IMPORTER PLUGINS ONLY: The <a class="el" href="class_assimp_1_1_base_importer.html" title="FOR IMPORTER PLUGINS ONLY: The BaseImporter defines a common interface for all importer worker classe...">BaseImporter</a> defines a common interface for all importer worker classes.  
 <a href="class_assimp_1_1_base_importer.html#details">More...</a></p>

<p><a href="class_assimp_1_1_base_importer-members.html">List of all members.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:adb3ea815340aa65d3768033a9b69265e"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_assimp_1_1_base_importer.html#adb3ea815340aa65d3768033a9b69265e">BaseImporter</a> ()</td></tr>
<tr class="memdesc:adb3ea815340aa65d3768033a9b69265e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Constructor to be privately used by <a class="el" href="class_assimp_1_1_base_importer.html#ad2d8744585dcb094644b1caed04ac9ed">Importer</a>.  <a href="class_assimp_1_1_base_importer.html#adb3ea815340aa65d3768033a9b69265e"></a><br/></td></tr>
<tr class="memitem:a13588d3396ba5b7ed1f1cb46e0945cfd"><td class="memItemLeft" align="right" valign="top">virtual bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_assimp_1_1_base_importer.html#a13588d3396ba5b7ed1f1cb46e0945cfd">CanRead</a> (const std::string &amp;pFile, <a class="el" href="class_assimp_1_1_i_o_system.html">IOSystem</a> *pIOHandler, bool checkSig) const =0</td></tr>
<tr class="memdesc:a13588d3396ba5b7ed1f1cb46e0945cfd"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns whether the class can handle the format of the given file.  <a href="class_assimp_1_1_base_importer.html#a13588d3396ba5b7ed1f1cb46e0945cfd"></a><br/></td></tr>
<tr class="memitem:a223f616a340ef2a56c12403f8758f0e7"><td class="memItemLeft" align="right" valign="top">const std::string &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_assimp_1_1_base_importer.html#a223f616a340ef2a56c12403f8758f0e7">GetErrorText</a> () const </td></tr>
<tr class="memdesc:a223f616a340ef2a56c12403f8758f0e7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the error description of the last error that occured.  <a href="class_assimp_1_1_base_importer.html#a223f616a340ef2a56c12403f8758f0e7"></a><br/></td></tr>
<tr class="memitem:a7a658f1192a37e336ba98fe701918b31"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_assimp_1_1_base_importer.html#a7a658f1192a37e336ba98fe701918b31">GetExtensionList</a> (std::set&lt; std::string &gt; &amp;extensions)</td></tr>
<tr class="memdesc:a7a658f1192a37e336ba98fe701918b31"><td class="mdescLeft">&#160;</td><td class="mdescRight">Called by #Importer::GetExtensionList for each loaded importer.  <a href="class_assimp_1_1_base_importer.html#a7a658f1192a37e336ba98fe701918b31"></a><br/></td></tr>
<tr class="memitem:a070b8c3f63767ad535c8ac509b725fc4"><td class="memItemLeft" align="right" valign="top">virtual const <a class="el" href="structai_importer_desc.html">aiImporterDesc</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_assimp_1_1_base_importer.html#a070b8c3f63767ad535c8ac509b725fc4">GetInfo</a> () const =0</td></tr>
<tr class="memdesc:a070b8c3f63767ad535c8ac509b725fc4"><td class="mdescLeft">&#160;</td><td class="mdescRight">Called by #Importer::GetImporterInfo to get a description of some loader features.  <a href="class_assimp_1_1_base_importer.html#a070b8c3f63767ad535c8ac509b725fc4"></a><br/></td></tr>
<tr class="memitem:af46b483eb1cdadb9a95265d188030271"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structai_scene.html">aiScene</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_assimp_1_1_base_importer.html#af46b483eb1cdadb9a95265d188030271">ReadFile</a> (const <a class="el" href="class_assimp_1_1_importer.html">Importer</a> *pImp, const std::string &amp;pFile, <a class="el" href="class_assimp_1_1_i_o_system.html">IOSystem</a> *pIOHandler)</td></tr>
<tr class="memdesc:af46b483eb1cdadb9a95265d188030271"><td class="mdescLeft">&#160;</td><td class="mdescRight">Imports the given file and returns the imported data.  <a href="class_assimp_1_1_base_importer.html#af46b483eb1cdadb9a95265d188030271"></a><br/></td></tr>
<tr class="memitem:ac076d9136745e898d43d9ea8f0d0c586"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_assimp_1_1_base_importer.html#ac076d9136745e898d43d9ea8f0d0c586">SetupProperties</a> (const <a class="el" href="class_assimp_1_1_importer.html">Importer</a> *pImp)</td></tr>
<tr class="memdesc:ac076d9136745e898d43d9ea8f0d0c586"><td class="mdescLeft">&#160;</td><td class="mdescRight">Called prior to <a class="el" href="class_assimp_1_1_base_importer.html#af46b483eb1cdadb9a95265d188030271" title="Imports the given file and returns the imported data.">ReadFile()</a>.  <a href="class_assimp_1_1_base_importer.html#ac076d9136745e898d43d9ea8f0d0c586"></a><br/></td></tr>
<tr class="memitem:a26c31a016f1249acac85d81ecb7fa252"><td class="memItemLeft" align="right" valign="top">virtual&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_assimp_1_1_base_importer.html#a26c31a016f1249acac85d81ecb7fa252">~BaseImporter</a> ()</td></tr>
<tr class="memdesc:a26c31a016f1249acac85d81ecb7fa252"><td class="mdescLeft">&#160;</td><td class="mdescRight">Destructor, private as well.  <a href="class_assimp_1_1_base_importer.html#a26c31a016f1249acac85d81ecb7fa252"></a><br/></td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2><a name="pub-static-methods"></a>
Static Public Member Functions</h2></td></tr>
<tr class="memitem:a0f9804d0d2744c7c1f0a45f941a9f432"><td class="memItemLeft" align="right" valign="top">static bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_assimp_1_1_base_importer.html#a0f9804d0d2744c7c1f0a45f941a9f432">CheckMagicToken</a> (<a class="el" href="class_assimp_1_1_i_o_system.html">IOSystem</a> *pIOHandler, const std::string &amp;pFile, const void *magic, unsigned int num, unsigned int offset=0, unsigned int size=4)</td></tr>
<tr class="memdesc:a0f9804d0d2744c7c1f0a45f941a9f432"><td class="mdescLeft">&#160;</td><td class="mdescRight">Check whether a file starts with one or more magic tokens.  <a href="class_assimp_1_1_base_importer.html#a0f9804d0d2744c7c1f0a45f941a9f432"></a><br/></td></tr>
<tr class="memitem:afc318aa0eb85b73f501156a50f3eb703"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_assimp_1_1_base_importer.html#afc318aa0eb85b73f501156a50f3eb703">ConvertToUTF8</a> (std::vector&lt; char &gt; &amp;data)</td></tr>
<tr class="memdesc:afc318aa0eb85b73f501156a50f3eb703"><td class="mdescLeft">&#160;</td><td class="mdescRight">An utility for all text file loaders.  <a href="class_assimp_1_1_base_importer.html#afc318aa0eb85b73f501156a50f3eb703"></a><br/></td></tr>
<tr class="memitem:a25edd42695863af078d2bab65077ce6c"><td class="memItemLeft" align="right" valign="top">static std::string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_assimp_1_1_base_importer.html#a25edd42695863af078d2bab65077ce6c">GetExtension</a> (const std::string &amp;pFile)</td></tr>
<tr class="memdesc:a25edd42695863af078d2bab65077ce6c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Extract file extension from a string.  <a href="class_assimp_1_1_base_importer.html#a25edd42695863af078d2bab65077ce6c"></a><br/></td></tr>
<tr class="memitem:a2489b5c3231d4b3bee049cd3daaa355d"><td class="memItemLeft" align="right" valign="top">static bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_assimp_1_1_base_importer.html#a2489b5c3231d4b3bee049cd3daaa355d">SearchFileHeaderForToken</a> (<a class="el" href="class_assimp_1_1_i_o_system.html">IOSystem</a> *pIOSystem, const std::string &amp;file, const char **tokens, unsigned int numTokens, unsigned int searchBytes=200, bool tokensSol=false)</td></tr>
<tr class="memdesc:a2489b5c3231d4b3bee049cd3daaa355d"><td class="mdescLeft">&#160;</td><td class="mdescRight">A utility for <a class="el" href="class_assimp_1_1_base_importer.html#a13588d3396ba5b7ed1f1cb46e0945cfd" title="Returns whether the class can handle the format of the given file.">CanRead()</a>.  <a href="class_assimp_1_1_base_importer.html#a2489b5c3231d4b3bee049cd3daaa355d"></a><br/></td></tr>
<tr class="memitem:a901421d4357b5a4939abe11f23e4357e"><td class="memItemLeft" align="right" valign="top">static bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_assimp_1_1_base_importer.html#a901421d4357b5a4939abe11f23e4357e">SimpleExtensionCheck</a> (const std::string &amp;pFile, const char *ext0, const char *ext1=NULL, const char *ext2=NULL)</td></tr>
<tr class="memdesc:a901421d4357b5a4939abe11f23e4357e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Check whether a file has a specific file extension.  <a href="class_assimp_1_1_base_importer.html#a901421d4357b5a4939abe11f23e4357e"></a><br/></td></tr>
<tr class="memitem:a4e28d285b48f3a50167476fc9b29aa21"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_assimp_1_1_base_importer.html#a4e28d285b48f3a50167476fc9b29aa21">TextFileToBuffer</a> (<a class="el" href="class_assimp_1_1_i_o_stream.html">IOStream</a> *stream, std::vector&lt; char &gt; &amp;data)</td></tr>
<tr class="memdesc:a4e28d285b48f3a50167476fc9b29aa21"><td class="mdescLeft">&#160;</td><td class="mdescRight">Utility for text file loaders which copies the contents of the file into a memory buffer and converts it to our UTF8 representation.  <a href="class_assimp_1_1_base_importer.html#a4e28d285b48f3a50167476fc9b29aa21"></a><br/></td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2><a name="pro-methods"></a>
Protected Member Functions</h2></td></tr>
<tr class="memitem:ac67d9f5ceb26353d27d6be06cccad398"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_assimp_1_1_base_importer.html#ac67d9f5ceb26353d27d6be06cccad398">InternReadFile</a> (const std::string &amp;pFile, <a class="el" href="structai_scene.html">aiScene</a> *pScene, <a class="el" href="class_assimp_1_1_i_o_system.html">IOSystem</a> *pIOHandler)=0</td></tr>
<tr class="memdesc:ac67d9f5ceb26353d27d6be06cccad398"><td class="mdescLeft">&#160;</td><td class="mdescRight">Imports the given file into the given scene structure.  <a href="class_assimp_1_1_base_importer.html#ac67d9f5ceb26353d27d6be06cccad398"></a><br/></td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2><a name="pro-attribs"></a>
Protected Attributes</h2></td></tr>
<tr class="memitem:a7531969813de75ee5ae2f6be245abfb8"><td class="memItemLeft" align="right" valign="top">std::string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_assimp_1_1_base_importer.html#a7531969813de75ee5ae2f6be245abfb8">mErrorText</a></td></tr>
<tr class="memdesc:a7531969813de75ee5ae2f6be245abfb8"><td class="mdescLeft">&#160;</td><td class="mdescRight">Error description in case there was one.  <a href="class_assimp_1_1_base_importer.html#a7531969813de75ee5ae2f6be245abfb8"></a><br/></td></tr>
<tr class="memitem:addeaa8583012cf1727194710321ca02b"><td class="memItemLeft" align="right" valign="top"><a class="el" href="class_assimp_1_1_progress_handler.html">ProgressHandler</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_assimp_1_1_base_importer.html#addeaa8583012cf1727194710321ca02b">progress</a></td></tr>
<tr class="memdesc:addeaa8583012cf1727194710321ca02b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Currently set progress handler.  <a href="class_assimp_1_1_base_importer.html#addeaa8583012cf1727194710321ca02b"></a><br/></td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2><a name="friends"></a>
Friends</h2></td></tr>
<tr class="memitem:ad2d8744585dcb094644b1caed04ac9ed"><td class="memItemLeft" align="right" valign="top">class&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_assimp_1_1_base_importer.html#ad2d8744585dcb094644b1caed04ac9ed">Importer</a></td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><p>FOR IMPORTER PLUGINS ONLY: The <a class="el" href="class_assimp_1_1_base_importer.html" title="FOR IMPORTER PLUGINS ONLY: The BaseImporter defines a common interface for all importer worker classe...">BaseImporter</a> defines a common interface for all importer worker classes. </p>
<p>The interface defines two functions: <a class="el" href="class_assimp_1_1_base_importer.html#a13588d3396ba5b7ed1f1cb46e0945cfd" title="Returns whether the class can handle the format of the given file.">CanRead()</a> is used to check if the importer can handle the format of the given file. If an implementation of this function returns true, the importer then calls <a class="el" href="class_assimp_1_1_base_importer.html#af46b483eb1cdadb9a95265d188030271" title="Imports the given file and returns the imported data.">ReadFile()</a> which imports the given file. ReadFile is not overridable, it just calls <a class="el" href="class_assimp_1_1_base_importer.html#ac67d9f5ceb26353d27d6be06cccad398" title="Imports the given file into the given scene structure.">InternReadFile()</a> and catches any ImportErrorException that might occur. </p>
</div><hr/><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="adb3ea815340aa65d3768033a9b69265e"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Assimp::BaseImporter::BaseImporter </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Constructor to be privately used by <a class="el" href="class_assimp_1_1_base_importer.html#ad2d8744585dcb094644b1caed04ac9ed">Importer</a>. </p>

</div>
</div>
<a class="anchor" id="a26c31a016f1249acac85d81ecb7fa252"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual Assimp::BaseImporter::~BaseImporter </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Destructor, private as well. </p>

</div>
</div>
<hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="a13588d3396ba5b7ed1f1cb46e0945cfd"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual bool Assimp::BaseImporter::CanRead </td>
          <td>(</td>
          <td class="paramtype">const std::string &amp;&#160;</td>
          <td class="paramname"><em>pFile</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="class_assimp_1_1_i_o_system.html">IOSystem</a> *&#160;</td>
          <td class="paramname"><em>pIOHandler</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>checkSig</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Returns whether the class can handle the format of the given file. </p>
<p>The implementation should be as quick as possible. A check for the file extension is enough. If no suitable loader is found with this strategy, <a class="el" href="class_assimp_1_1_base_importer.html#a13588d3396ba5b7ed1f1cb46e0945cfd" title="Returns whether the class can handle the format of the given file.">CanRead()</a> is called again, the 'checkSig' parameter set to true this time. Now the implementation is expected to perform a full check of the file structure, possibly searching the first bytes of the file for magic identifiers or keywords.</p>
<dl class="params"><dt>Parameters:</dt><dd>
  <table class="params">
    <tr><td class="paramname">pFile</td><td>Path and file name of the file to be examined. </td></tr>
    <tr><td class="paramname">pIOHandler</td><td>The IO handler to use for accessing any file. </td></tr>
    <tr><td class="paramname">checkSig</td><td>Set to true if this method is called a second time. This time, the implementation may take more time to examine the contents of the file to be loaded for magic bytes, keywords, etc to be able to load files with unknown/not existent file extensions. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns:</dt><dd>true if the class can read this file, false if not. </dd></dl>

</div>
</div>
<a class="anchor" id="a0f9804d0d2744c7c1f0a45f941a9f432"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static bool Assimp::BaseImporter::CheckMagicToken </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="class_assimp_1_1_i_o_system.html">IOSystem</a> *&#160;</td>
          <td class="paramname"><em>pIOHandler</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const std::string &amp;&#160;</td>
          <td class="paramname"><em>pFile</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const void *&#160;</td>
          <td class="paramname"><em>magic</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned int&#160;</td>
          <td class="paramname"><em>num</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned int&#160;</td>
          <td class="paramname"><em>offset</em> = <code>0</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned int&#160;</td>
          <td class="paramname"><em>size</em> = <code>4</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Check whether a file starts with one or more magic tokens. </p>
<dl class="params"><dt>Parameters:</dt><dd>
  <table class="params">
    <tr><td class="paramname">pFile</td><td>Input file </td></tr>
    <tr><td class="paramname">pIOHandler</td><td>IO system to be used </td></tr>
    <tr><td class="paramname">magic</td><td>n magic tokens  num Size of magic </td></tr>
    <tr><td class="paramname">offset</td><td>Offset from file start where tokens are located </td></tr>
    <tr><td class="paramname">Size</td><td>of one token, in bytes. Maximally 16 bytes. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns:</dt><dd>true if one of the given tokens was found</dd></dl>
<dl class="section note"><dt>Note:</dt><dd>For convinence, the check is also performed for the byte-swapped variant of all tokens (big endian). Only for tokens of size 2,4. </dd></dl>

</div>
</div>
<a class="anchor" id="afc318aa0eb85b73f501156a50f3eb703"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static void Assimp::BaseImporter::ConvertToUTF8 </td>
          <td>(</td>
          <td class="paramtype">std::vector&lt; char &gt; &amp;&#160;</td>
          <td class="paramname"><em>data</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>An utility for all text file loaders. </p>
<p>It converts a file to our UTF8 character set. Errors are reported, but ignored.</p>
<dl class="params"><dt>Parameters:</dt><dd>
  <table class="params">
    <tr><td class="paramname">data</td><td>File buffer to be converted to UTF8 data. The buffer is resized as appropriate. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a223f616a340ef2a56c12403f8758f0e7"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">const std::string&amp; Assimp::BaseImporter::GetErrorText </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Returns the error description of the last error that occured. </p>
<dl class="section return"><dt>Returns:</dt><dd>A description of the last error that occured. An empty string if there was no error. </dd></dl>

</div>
</div>
<a class="anchor" id="a25edd42695863af078d2bab65077ce6c"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static std::string Assimp::BaseImporter::GetExtension </td>
          <td>(</td>
          <td class="paramtype">const std::string &amp;&#160;</td>
          <td class="paramname"><em>pFile</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Extract file extension from a string. </p>
<dl class="params"><dt>Parameters:</dt><dd>
  <table class="params">
    <tr><td class="paramname">pFile</td><td>Input file </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns:</dt><dd>Extension without trailing dot, all lowercase </dd></dl>

</div>
</div>
<a class="anchor" id="a7a658f1192a37e336ba98fe701918b31"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Assimp::BaseImporter::GetExtensionList </td>
          <td>(</td>
          <td class="paramtype">std::set&lt; std::string &gt; &amp;&#160;</td>
          <td class="paramname"><em>extensions</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Called by #Importer::GetExtensionList for each loaded importer. </p>
<p>Take the extension list contained in the structure returned by <a class="el" href="class_assimp_1_1_base_importer.html#a070b8c3f63767ad535c8ac509b725fc4" title="Called by #Importer::GetImporterInfo to get a description of some loader features.">GetInfo</a> and insert all file extensions into the given set. </p>
<dl class="params"><dt>Parameters:</dt><dd>
  <table class="params">
    <tr><td class="paramname">extension</td><td>set to collect file extensions in </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a070b8c3f63767ad535c8ac509b725fc4"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual const <a class="el" href="structai_importer_desc.html">aiImporterDesc</a>* Assimp::BaseImporter::GetInfo </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Called by #Importer::GetImporterInfo to get a description of some loader features. </p>
<p>Importers must provide this information. </p>

</div>
</div>
<a class="anchor" id="ac67d9f5ceb26353d27d6be06cccad398"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual void Assimp::BaseImporter::InternReadFile </td>
          <td>(</td>
          <td class="paramtype">const std::string &amp;&#160;</td>
          <td class="paramname"><em>pFile</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structai_scene.html">aiScene</a> *&#160;</td>
          <td class="paramname"><em>pScene</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="class_assimp_1_1_i_o_system.html">IOSystem</a> *&#160;</td>
          <td class="paramname"><em>pIOHandler</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span><span class="mlabel">pure virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Imports the given file into the given scene structure. </p>
<p>The function is expected to throw an ImportErrorException if there is an error. If it terminates normally, the data in <a class="el" href="structai_scene.html" title="The root structure of the imported data.">aiScene</a> is expected to be correct. Override this function to implement the actual importing. <br/>
 The output scene must meet the following requirements:<br/>
 </p>
<ul>
<li>
At least a root node must be there, even if its only purpose is to reference one mesh. </li>
<li>
<a class="el" href="structai_mesh.html#a99d66ac0a444068c1b252b30265cbf53" title="Bitwise combination of the members of the aiPrimitiveType enum.">aiMesh::mPrimitiveTypes</a> may be 0. The types of primitives in the mesh are determined automatically in this case. </li>
<li>
the vertex data is stored in a pseudo-indexed "verbose" format. In fact this means that every vertex that is referenced by a face is unique. Or the other way round: a vertex index may not occur twice in a single <a class="el" href="structai_mesh.html" title="A mesh represents a geometry or model with a single material.">aiMesh</a>. </li>
<li>
<a class="el" href="structai_animation.html#ae2bbc49320b4b75c05e23e0ab704ece7" title="Duration of the animation in ticks.">aiAnimation::mDuration</a> may be -1. <a class="el" href="namespace_assimp.html" title="Assimp&#39;s CPP-API and all internal APIs.">Assimp</a> determines the length of the animation automatically in this case as the length of the longest animation channel. </li>
<li>
<a class="el" href="structai_mesh.html#af04bb8da6485a98d2a452ba54b8a1039" title="Vertex bitangents.">aiMesh::mBitangents</a> may be NULL if tangents and normals are given. In this case bitangents are computed as the cross product between normal and tangent. </li>
<li>
There needn't be a material. If none is there a default material is generated. However, it is recommended practice for loaders to generate a default material for yourself that matches the default material setting for the file format better than <a class="el" href="namespace_assimp.html" title="Assimp&#39;s CPP-API and all internal APIs.">Assimp</a>'s generic default material. Note that default materials <em>should</em> be named AI_DEFAULT_MATERIAL_NAME if they're just color-shaded or AI_DEFAULT_TEXTURED_MATERIAL_NAME if they define a (dummy) texture.  </li>
</ul>
<p>If the AI_SCENE_FLAGS_INCOMPLETE-Flag is <b>not</b> set:</p>
<ul>
<li>
at least one mesh must be there </li>
<li>
there may be no meshes with 0 vertices or faces </li>
</ul>
<p>This won't be checked (except by the validation step): <a class="el" href="namespace_assimp.html" title="Assimp&#39;s CPP-API and all internal APIs.">Assimp</a> will crash if one of the conditions is not met!</p>
<dl class="params"><dt>Parameters:</dt><dd>
  <table class="params">
    <tr><td class="paramname">pFile</td><td>Path of the file to be imported. </td></tr>
    <tr><td class="paramname">pScene</td><td>The scene object to hold the imported data. NULL is not a valid parameter. </td></tr>
    <tr><td class="paramname">pIOHandler</td><td>The IO handler to use for any file access. NULL is not a valid parameter. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="af46b483eb1cdadb9a95265d188030271"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structai_scene.html">aiScene</a>* Assimp::BaseImporter::ReadFile </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="class_assimp_1_1_importer.html">Importer</a> *&#160;</td>
          <td class="paramname"><em>pImp</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const std::string &amp;&#160;</td>
          <td class="paramname"><em>pFile</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="class_assimp_1_1_i_o_system.html">IOSystem</a> *&#160;</td>
          <td class="paramname"><em>pIOHandler</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Imports the given file and returns the imported data. </p>
<p>If the import succeeds, ownership of the data is transferred to the caller. If the import fails, NULL is returned. The function takes care that any partially constructed data is destroyed beforehand.</p>
<dl class="params"><dt>Parameters:</dt><dd>
  <table class="params">
    <tr><td class="paramname">pImp</td><td><a class="el" href="class_assimp_1_1_base_importer.html#ad2d8744585dcb094644b1caed04ac9ed">Importer</a> object hosting this loader. </td></tr>
    <tr><td class="paramname">pFile</td><td>Path of the file to be imported. </td></tr>
    <tr><td class="paramname">pIOHandler</td><td>IO-Handler used to open this and possible other files. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns:</dt><dd>The imported data or NULL if failed. If it failed a human-readable error description can be retrieved by calling <a class="el" href="class_assimp_1_1_base_importer.html#a223f616a340ef2a56c12403f8758f0e7" title="Returns the error description of the last error that occured.">GetErrorText()</a></dd></dl>
<dl class="section note"><dt>Note:</dt><dd>This function is not intended to be overridden. Implement <a class="el" href="class_assimp_1_1_base_importer.html#ac67d9f5ceb26353d27d6be06cccad398" title="Imports the given file into the given scene structure.">InternReadFile()</a> to do the import. If an exception is thrown somewhere in <a class="el" href="class_assimp_1_1_base_importer.html#ac67d9f5ceb26353d27d6be06cccad398" title="Imports the given file into the given scene structure.">InternReadFile()</a>, this function will catch it and transform it into a suitable response to the caller. </dd></dl>

</div>
</div>
<a class="anchor" id="a2489b5c3231d4b3bee049cd3daaa355d"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static bool Assimp::BaseImporter::SearchFileHeaderForToken </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="class_assimp_1_1_i_o_system.html">IOSystem</a> *&#160;</td>
          <td class="paramname"><em>pIOSystem</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const std::string &amp;&#160;</td>
          <td class="paramname"><em>file</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char **&#160;</td>
          <td class="paramname"><em>tokens</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned int&#160;</td>
          <td class="paramname"><em>numTokens</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned int&#160;</td>
          <td class="paramname"><em>searchBytes</em> = <code>200</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>tokensSol</em> = <code>false</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>A utility for <a class="el" href="class_assimp_1_1_base_importer.html#a13588d3396ba5b7ed1f1cb46e0945cfd" title="Returns whether the class can handle the format of the given file.">CanRead()</a>. </p>
<p>The function searches the header of a file for a specific token and returns true if this token is found. This works for text files only. There is a rudimentary handling of UNICODE files. The comparison is case independent.</p>
<dl class="params"><dt>Parameters:</dt><dd>
  <table class="params">
    <tr><td class="paramname">pIOSystem</td><td>IO System to work with </td></tr>
    <tr><td class="paramname">file</td><td>File name of the file </td></tr>
    <tr><td class="paramname">tokens</td><td>List of tokens to search for </td></tr>
    <tr><td class="paramname">numTokens</td><td>Size of the token array </td></tr>
    <tr><td class="paramname">searchBytes</td><td>Number of bytes to be searched for the tokens. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ac076d9136745e898d43d9ea8f0d0c586"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual void Assimp::BaseImporter::SetupProperties </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="class_assimp_1_1_importer.html">Importer</a> *&#160;</td>
          <td class="paramname"><em>pImp</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Called prior to <a class="el" href="class_assimp_1_1_base_importer.html#af46b483eb1cdadb9a95265d188030271" title="Imports the given file and returns the imported data.">ReadFile()</a>. </p>
<p>The function is a request to the importer to update its configuration basing on the <a class="el" href="class_assimp_1_1_importer.html" title="CPP-API: The Importer class forms an C++ interface to the functionality of the Open Asset Import Libr...">Importer</a>'s configuration property list. </p>
<dl class="params"><dt>Parameters:</dt><dd>
  <table class="params">
    <tr><td class="paramname">pImp</td><td><a class="el" href="class_assimp_1_1_importer.html" title="CPP-API: The Importer class forms an C++ interface to the functionality of the Open Asset Import Libr...">Importer</a> instance </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a901421d4357b5a4939abe11f23e4357e"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static bool Assimp::BaseImporter::SimpleExtensionCheck </td>
          <td>(</td>
          <td class="paramtype">const std::string &amp;&#160;</td>
          <td class="paramname"><em>pFile</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>ext0</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>ext1</em> = <code>NULL</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>ext2</em> = <code>NULL</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Check whether a file has a specific file extension. </p>
<dl class="params"><dt>Parameters:</dt><dd>
  <table class="params">
    <tr><td class="paramname">pFile</td><td>Input file </td></tr>
    <tr><td class="paramname">ext0</td><td>Extension to check for. Lowercase characters only, no dot! </td></tr>
    <tr><td class="paramname">ext1</td><td>Optional second extension </td></tr>
    <tr><td class="paramname">ext2</td><td>Optional third extension </td></tr>
  </table>
  </dd>
</dl>
<dl class="section note"><dt>Note:</dt><dd>Case-insensitive </dd></dl>

</div>
</div>
<a class="anchor" id="a4e28d285b48f3a50167476fc9b29aa21"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static void Assimp::BaseImporter::TextFileToBuffer </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="class_assimp_1_1_i_o_stream.html">IOStream</a> *&#160;</td>
          <td class="paramname"><em>stream</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">std::vector&lt; char &gt; &amp;&#160;</td>
          <td class="paramname"><em>data</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Utility for text file loaders which copies the contents of the file into a memory buffer and converts it to our UTF8 representation. </p>
<dl class="params"><dt>Parameters:</dt><dd>
  <table class="params">
    <tr><td class="paramname">stream</td><td>Stream to read from. </td></tr>
    <tr><td class="paramname">data</td><td>Output buffer to be resized and filled with the converted text file data. The buffer is terminated with a binary 0. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<hr/><h2>Friends And Related Function Documentation</h2>
<a class="anchor" id="ad2d8744585dcb094644b1caed04ac9ed"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">friend class <a class="el" href="class_assimp_1_1_importer.html">Importer</a></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">friend</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

</div>
</div>
<hr/><h2>Member Data Documentation</h2>
<a class="anchor" id="a7531969813de75ee5ae2f6be245abfb8"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">std::string Assimp::BaseImporter::mErrorText</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Error description in case there was one. </p>

</div>
</div>
<a class="anchor" id="addeaa8583012cf1727194710321ca02b"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="class_assimp_1_1_progress_handler.html">ProgressHandler</a>* Assimp::BaseImporter::progress</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Currently set progress handler. </p>

</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="_base_importer_8h.html">BaseImporter.h</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Tue Jul 10 2012 17:55:53 for Assimp by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.1.1
</small></address>
</body>
</html>
